package com.tb.zookeeper;

import org.I0Itec.zkclient.ZkClient;
import org.apache.zookeeper.ClientCnxn;
import org.apache.zookeeper.CreateMode;

/**
 * 作者：tb
 * 描述：todo
 * 日期：Created in 2022/4/7 11:26
 *
 * @Version 1.0
 */
public class ZkCilentTest {
    public static void main(String[] args) {
        ZkClient zkClient = new ZkClient("127.0.0.1:2183",5000);
        zkClient.delete("/myage");
        zkClient.create("/myage","22",CreateMode.PERSISTENT);
        zkClient.writeData("/myage","45");
        String info = zkClient.readData("/myage");
        System.out.println("info:"+info);
    }
}
